package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.CustomerPetMapper;
import com.ruoyi.hospital.domain.CustomerPet;
import com.ruoyi.hospital.service.ICustomerPetService;

/**
 * 客户宠物信息Service业务层处理
 * 
 * @author qichi
 * @date 2023-07-04
 */
@Service
public class CustomerPetServiceImpl implements ICustomerPetService 
{
    @Autowired
    private CustomerPetMapper customerPetMapper;

    /**
     * 查询客户宠物信息
     * 
     * @param id 客户宠物信息主键
     * @return 客户宠物信息
     */
    @Override
    public CustomerPet selectCustomerPetById(Long id)
    {
        return customerPetMapper.selectCustomerPetById(id);
    }

    /**
     * 查询客户宠物信息列表
     * 
     * @param customerPet 客户宠物信息
     * @return 客户宠物信息
     */
    @Override
    public List<CustomerPet> selectCustomerPetList(CustomerPet customerPet)
    {
        return customerPetMapper.selectCustomerPetList(customerPet);
    }

    /**
     * 新增客户宠物信息
     * 
     * @param customerPet 客户宠物信息
     * @return 结果
     */
    @Override
    public int insertCustomerPet(CustomerPet customerPet)
    {
        customerPet.setCreateTime(DateUtils.getNowDate());
        return customerPetMapper.insertCustomerPet(customerPet);
    }

    /**
     * 修改客户宠物信息
     * 
     * @param customerPet 客户宠物信息
     * @return 结果
     */
    @Override
    public int updateCustomerPet(CustomerPet customerPet)
    {
        customerPet.setUpdateTime(DateUtils.getNowDate());
        return customerPetMapper.updateCustomerPet(customerPet);
    }

    /**
     * 批量删除客户宠物信息
     * 
     * @param ids 需要删除的客户宠物信息主键
     * @return 结果
     */
    @Override
    public int deleteCustomerPetByIds(Long[] ids)
    {
        return customerPetMapper.deleteCustomerPetByIds(ids);
    }

    /**
     * 删除客户宠物信息信息
     * 
     * @param id 客户宠物信息主键
     * @return 结果
     */
    @Override
    public int deleteCustomerPetById(Long id)
    {
        return customerPetMapper.deleteCustomerPetById(id);
    }
}
